<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script>
    //打印催单
    function reminderPrint(){
        //if($("#contentTable .table-selected").length>0){
            var patientId = $("#contentTable .table-selected").find("td").eq(0).find("input").val();
            printPdf('${ctx}/finance/patPrepayment/reminderPrint', 'patientId=' + patientId);
       /* }else{
            toastr.info("请选择要打印预交金催单的病人！");
        }*/

    }

    //打印清单
    function detailedListPrint(){

        if($("#contentTable .table-selected").length>0){
            var patientId = $("#contentTable .table-selected").find("td").eq(0).find("input").val();
            var money=$("#money").val();
            printPdf('${ctx}/finance/patPrepayment/detailedListPrint', 'patientId=' + patientId+"&money="+money);
        }else{
            toastr.info("请选择要打印预交金清单的病人！");
        }
    }
</script>
<div class="app">
  <section class="layout">
    <section class="main-content col-lg-12" id="LeftDiv">
      <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
          <ul class="nav nav-tabs">
            <li><a href="#" onclick="loadDiv('nurseIndexDiv','${ctx}/nurse/index')">床位列表</a></li>
            <li  class="active">
              <a href="#" onclick="loadDiv('nurseIndexDiv','${ctx}/finance/patPrepayment/waitPrepayList')">催补预交金</a>
            </li>
          </ul>
          <section class="panel panel-default">
            <div class="panel-body">
              <div class="table-responsive no-border">
                <div class="datatable-top">
                  <div class="pull-left">
                   <form:form id="searchFormDict" modelAttribute="patPrepayment" onsubmit="return loadDivForm('nurseIndexDiv','searchFormDict','${ctx}/finance/patPrepayment/waitPrepayList');" method="post" class="form-inline">
                     <label>当剩余预交金小于这个数值是需催款：</label><form:input path="money" id="money"  htmlEscape="false" maxlength="100" class="form-control" type="number"/>
                     &nbsp;<label>打印前请查询并选中要打印的病人</label>
                     &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                     &nbsp;<input id="btnSubmit" onclick="reminderPrint()"  class="btn btn-info" type="button" value="打印催单"/>
<%--                     &nbsp;<input id="btnSubmit" onclick="detailedListPrint()" class="btn btn-info" type="button" value="打印清单"/>--%>
                    </form:form>
                  </div>

                </div>
                <table id="contentTable" class="table table-bordered mg-t datatable">
                  <thead><tr><th>床标号</th><th>床号</th><th>姓名</th><th>病区</th><th>入院时间</th><th>预交金总额</th><th>计价费用</th><th>应交费用</th><th>预交金余额</th><th>费别</th></tr></thead>
                  <tbody>
                  <c:forEach items="${list}" var="o">
                  <tr>
                    <td>${o.bed_label}<input type="hidden" value="${o.patient_id}"/> </td>
                    <td>${o.bed_no}</td>
                    <td>${o.name}</td>
                    <td>${o.ward_code}</td>
                    <td>${o.admission_date_time} </td>
                    <td>${o.prepayments}</td>
                    <td>${o.total_costs}</td>
                    <td>${o.total_charges}</td>
                    <td>${o.balance}</td>
                    <td>${o.charge_type}</td>
                  </tr>
                  </c:forEach>
                </table>
            </div>
            </div>
          </section>
        </div>
      </div>
    </section>
  </section>
</div>
